c436a7d815c7eddd22800788295b9a2756da00f9,java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java,JavaFindUsagesHandler,addMethodsUsages,#PsiClass#Processor#JavaClassFindUsagesOptions#,461
Before Change
}
else {
for (PsiMethod method : aClass.getMethods()) {
addElementUsages(method, results, options);
}
}
}
After Change
}
private static boolean addMethodsUsages(@NotNull final PsiClass aClass,
@NotNull final Processor<UsageInfo> processor,
@NotNull final JavaClassFindUsagesOptions options) {
if (options.isIncludeInherited) {
final PsiManager manager = aClass.getManager();
PsiMethod[] methods = aClass.getAllMethods();
MethodsLoop:
for(int i = 0; i < methods.length; i++){
final PsiMethod method = methods[i];
// filter overriden methods
MethodSignature methodSignature = method.getSignature(PsiSubstitutor.EMPTY);
for(int j = 0; j < i; j++){
if (methodSignature.equals(methods[j].getSignature(PsiSubstitutor.EMPTY))) continue MethodsLoop;
}
final PsiClass methodClass = method.getContainingClass();
if (methodClass != null && manager.areElementsEquivalent(methodClass, aClass)){
if (!addElementUsages(methods[i], processor, options)) return false;
}
else {
boolean success = MethodReferencesSearch.search(new MethodReferencesSearch.SearchParameters(method, options.searchScope, true, options.fastTrack))
.forEach(new PsiReferenceProcessorAdapter(new PsiReferenceProcessor() {
@Override
public boolean execute(PsiReference reference) {
addResultFromReference(reference, methodClass, manager, aClass, processor, options);
return true;
}
}));
if (!success) return false;
}
}
}
else {
for (PsiMethod method : aClass.getMethods()) {
if (!addElementUsages(method, processor, options)) return false;
}
}
return true;